import Vue from 'vue';
import Router from 'vue-router';
import Vuex from 'vuex';
import App from '../view/app.vue';
import Home from '../view/app/home.vue';

Vue.use(Router);
Vue.use(Vuex);

const router = new Router();

router.map({
    '/home': {
        component: Home
    },
    '/about': {
        component: function(resolve) {
            require(['../view/app/about.vue'], resolve);
        }
    },
    '/vuex': {
        component: function(resolve) {
            require(['../view/app/vuex.vue'], resolve);
        }
    }
});

router.redirect({
    '*': '/home'
});

router.start(App, 'app');
